
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_InsertMonHocDangKy]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
	drop procedure [dbo].[sp_InsertMonHocDangKy]
GO
create procedure sp_InsertMonHocDangKy
	@MaSV varchar(10),
	@MaMH varchar(10)	
as
begin			
	INSERT INTO DangKy
		(
			MaSV,
			MaMH
		)	
	VALUES	
		(
			@MaSV,
			@MaMH
		)
	--set @MaMH = (	Select count(DangKy.MaSV) as SLSV 
	--				From DangKy 
	--				Where DangKy.MaMH = @MaMH 
	--				Having count(DangKy.MaSV) <= 20
	--			)
end



